package com.net.library.interfaces;

import com.net.library.bean.AuthResult;
import com.net.library.bean.RespFileUpload;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.*;

/**
 * author 吴昶
 * date 2019/6/3
 * 标注
 */
public interface ServerDataInterface {

    @POST("...")
    Call<AuthResult> getAuthToken(@Query("grant_type")String grant_type,
                                  @Query("scope")String scope,
                                  @Query("client_id") String client_id,
                                  @Query("client_secret") String client_secret);


    @Multipart
    @POST("/app_user/uploadPic.do")
    Call<RespFileUpload> postPic(@Header("sid")String sid, @Part MultipartBody.Part file );


    /**
     * 以JSON 格式传递参数
     * @param body
     * @return
     */
    @Headers({"Content-Type:application/json",
            "Accept:application/json"})
    @POST("/queryPledge")
    Call<AuthResult> getTestData(@Body RequestBody body);

}
